//=============================================================================
// Project  : NIPO Component Framework
// File    : IInputChecker.cs
// Author  : Bernhard Dieber (Bernhard.Dieber@uni-klu.ac.at)
// Copyright 2010 by Bernhard Dieber
// This code is published under the Microsoft Public License (Ms-PL).  A copy
// of the license should be distributed with the code.  It can also be found
// at the project website: http://NIPO.CodePlex.com.   This notice, the
// author's name, and all copyright notices must remain intact in all
// applications, documentation, and source files.
//=============================================================================

using System.Collections.Generic;
using NIPO.Data;

namespace NIPO.Plugins
{
    /// <summary>
    /// The IIputChecker checks if a possible input to a plugin can be processed.
    /// </summary>
    public interface IInputChecker
    {
        /// <summary>
        /// This method must return a set of acceptable inputs.
        /// </summary>
        /// <param eventName="possibleInput">A set of inputs that could be delivered by the preceeding plugin.</param>
        /// <returns>A set of acceptable inputs. This should be a subset of <paramref eventName="possibleInput"/>. The two sets will be checked for compatibility by the system.</returns>
        ICollection<DataTransferObject> GetAcceptableInput(IEnumerable<DataTransferObject> possibleInput);

        /// <summary>
        /// Notifies the plugins what types of input it should expect.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <param name="pluginID">The ID if the plugin that will deliver <paramref name="input"/>.</param>
        /// <returns><c>true</c> if the plugin will be able to accept the input, <c>false</c> otherwise</returns>
        /// <remarks>
        /// This method may be called multiple times during the matching stage.
        /// The plugin should acceptall formats set in all calls.
        /// </remarks>
        bool ExpectInput(NIPO.Data.DataTransferObject input, int pluginID);
    }
}